/*******************************************************************************************
This file is part of iToday.

iToday is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

iToday is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with iToday.  If not, see <http://www.gnu.org/licenses/>.
* ------------------------------------------------------------------------------
*    PoomUtility.h - poom functions  declaration
* ------------------------------------------------------------------------------
*    Revision History
*    Date                  Author         Activity ID               Activity Headline
*    2009-10-28            Congqin				none					initial
*******************************************************************************************/
#pragma once

#include <vector>

#define PRIMARY_TEXT_LENGTH     64
#define SECONDARY_TEXT_LENGTH   32

typedef LONG (* TAPIREQUESTMAKECALL)(LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR);

#define MAX_COMMAND_LINE 200


/// List DATA
typedef struct
{
    //int		        ID;
    LONG    	    oId;
    TCHAR           szPrimaryText[PRIMARY_TEXT_LENGTH];
    TCHAR		    szCategoriesText[SECONDARY_TEXT_LENGTH];
    UINT            iGroup;
} ContactDataItem ;

typedef struct
{
    TCHAR	m_szCurrentCategoryName[SECONDARY_TEXT_LENGTH];
} ContactCategoryData;

typedef enum
{
    SortButton,
    DailPhoneButton,
    EditButton,
    DetailsButton

} ContactButton;

bool IsFileExists(const TCHAR * szFilename) ;
bool GetIDialerFilename(TCHAR * szFilename);
void Call(TCHAR * number, TCHAR * name) ;

HRESULT InitPoom();

HRESULT PoomCategoriesPopulate( std::vector<ContactCategoryData> &vContactListData ) ;
HRESULT PoomPopulate( void (* adder )( ContactDataItem*, HANDLE ),HANDLE handle) ;
HRESULT ProcessPoomClick( ContactDataItem * data , ContactButton eParam ) ;
HRESULT PoomAddItem();


